#coding=utf-8

from stockdb.misc import *
import stseries.basic as sb

def get_lastdigit(n):
    return int( str( int(n*100) )[-1] )
    
con = sess.connection()
sql = 'select highest from price'
hs = con.execute(sql).fetchall()
ds = [get_lastdigit(h[0]) for h in hs]

l = len(ds)
print l

r = {}
for d in ds:
    if not r.has_key(d):r[d] = 1
    else:
        r[d] += 1
        
for k in r.keys():
    r[k] = r[k]*100.0/l
            
for k in sorted( r.keys() ):
    print k,  '%.2f%%'%r[k]
